package org.hilo.boot.core.rpc;

import org.jretty.util.NestedCheckedException;

/**
 * 
 * @author zollty
 * @since 2018-05-11
 */
public class RemoteException extends NestedCheckedException {
    private static final long serialVersionUID = -4252425053528683279L;
    private static final String EXCEPTION_PRIFIX = "(RemoteException) ";
    private String code;

    public RemoteException(Object message, Object... args) {
        super(message, args);
        getDelegate().setExceptionPrefix(EXCEPTION_PRIFIX);
    }

    public RemoteException(Throwable e) {
        super(e);
        getDelegate().setExceptionPrefix(EXCEPTION_PRIFIX);
    }

    public RemoteException(Throwable e, Object message, Object... args) {
        super(e, message, args);
        getDelegate().setExceptionPrefix(EXCEPTION_PRIFIX);
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @param code
     */
    public void setCode(String code) {
        this.code = code;
    }
}
